package top.iwife.httpclient.model;

/**
 * Author 张杰
 * CreateTime 2021/11/17
 * <p>
 * http response
 * 请求返回响应体
 */
public class HttpResponse {
    /**
     * http的状态码，如200、400、404、500
     */
    private final Integer statusCode;
    /**
     * http的状态码对应的信息，如OK、Not Found或者是异常信息
     */
    private final String reasonPhrase;
    /**
     * 远程服务器返回的对象信息
     */
    private byte[] data;

    public Integer getStatusCode() {
        return statusCode;
    }

    public String getReasonPhrase() {
        return reasonPhrase;
    }

    public Object getData() {
        return data;
    }

    public void setData(byte[] data) {
        this.data = data;
    }

    public HttpResponse(Integer statusCode, String reasonPhrase) {
        this.statusCode = statusCode;
        this.reasonPhrase = reasonPhrase;
    }

    public HttpResponse(Integer statusCode, String reasonPhrase, byte[] data) {
        this.statusCode = statusCode;
        this.reasonPhrase = reasonPhrase;
        this.data = data;
    }
}